package com.ts.main.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ts.main.admin.entity.ProductOptionValueEntity;
import com.ts.main.admin.mapper.ProductOptionValueMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lk
* @description 针对表【t_product_option_value】的数据库操作Service实现
* @createDate 2025-06-09 00:56:13
*/
@AllArgsConstructor
@Service
public class ProductOptionValueServiceImpl extends ServiceImpl<ProductOptionValueMapper, ProductOptionValueEntity> {

    public Boolean saveValue(Integer optionId, List<String> valueList) {
        return baseMapper.saveList(optionId,valueList);
    }

    public Boolean deleteValue(Integer optionId) {
        LambdaQueryWrapper<ProductOptionValueEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProductOptionValueEntity::getOptionId,optionId);
        return this.remove(queryWrapper);
    }

}




